from django.db import models

# Create your models here.


class Areas(models.Model):
    """创建地域模型类"""
    area_name = models.CharField(max_length=20,null=False,verbose_name="名称")
    parent = models.ForeignKey("self",on_delete=models.SET_NULL,related_name="subs",blank=True,null=True,verbose_name="上级行政区域")

    class Meta:
        db_table = "tb_areas"
        verbose_name = "地址名称"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.area_name